package com.taobaobao.com.taobaobao.module.shoppingcart;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.taobaobao.com.taobaobao.R;
import com.taobaobao.com.taobaobao.base.BaseFragment;

public class ShoppingCartFragment extends BaseFragment {

    private RecyclerView recyclerView;
    private ShoppingCartAdapter shoppingCartAdapter;

    @Override
    protected int setLayoutId() {
        return R.layout.fragment_shoppingcart;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        recyclerView = view.findViewById(R.id.recycler);
        initRecycle();
    }

    private void initRecycle() {
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
        recyclerView.setLayoutManager(linearLayoutManager);
        shoppingCartAdapter = new ShoppingCartAdapter(getActivity());
        recyclerView.setAdapter(shoppingCartAdapter);
    }
}
